<template>
    <div class="citylist">
        <van-index-bar :index-list="listNum">
            <div v-for="(item,key) in cityList" :key="key">
                <van-index-anchor class="title-color" :index="key"/>
                <van-cell v-for="(city,num) in item" :key="num" :title="city.name" @click="$emit('click',city.name)"/>
            </div>
        </van-index-bar>
    </div>
</template>

<script>
    export default {
        name: "citylist",
        props: {
            cityList: Object,
            listNum:Array
        }
    }
</script>

<style lang="scss" >
    @import "~css/varibles.scss";

    .title-color {
        background-color: $bgcolor-p;
        .van-index-anchor--sticky {
            background-color: $bgcolor-p;
        }
    }

</style>
